load("@fbcode_macros//build_defs:native_rules.bzl", "buck_filegroup")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "mononoke_proc_macros",
    srcs = glob([
        "proc_macros/**/*.rs",
    ]),
    autocargo = {
        "cargo_toml_dir": "proc_macros",
    },
    proc_macro = True,
    deps = [
        "fbsource//third-party/rust:quote",
        "fbsource//third-party/rust:syn1",
    ],
)

rust_library(
    name = "mononoke_macros",
    srcs = glob([
        "src/**/*.rs",
        "just_knobs_defaults/**/*.json",
    ]),
    deps = [
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tracing",
        ":mononoke_proc_macros",
        "//common/rust/shed/justknobs_stub:justknobs",
    ],
)

buck_filegroup(
    name = "just_knobs_defaults",
    srcs = [
        "just_knobs_defaults/just_knobs.json",
    ],
)
